#ifndef TEXTURE_H
#define TEXTURE_H

#include <string>
#include "Core/base.h"
#include "Renderer/font.h"

namespace CC {

    enum TextureType
    {
        TextureType_Repeat = 0,
        TextureType_ClampToEdge,
    };

	class CC_EXPORT Texture
	{
	public:
		virtual ~Texture() = default;

		virtual uint32_t GetWidth() const = 0;
		virtual uint32_t GetHeight() const = 0;
		virtual uint32_t GetRendererID() const = 0;

		virtual const std::string& GetPath() const = 0;

		virtual void SetData(void* data, uint32_t size) = 0;

		virtual void Bind(uint32_t slot = 0) const = 0;
		virtual void UnBind() const = 0;

		virtual bool IsLoaded() const = 0;

		virtual bool operator==(const Texture& other) const = 0;

		virtual void SetID(uint32_t id) = 0;
		virtual uint32_t GetID() = 0;
	};

	class CC_EXPORT Texture2D : public Texture
	{
	public:
		static Texture2D* Create(uint32_t width, uint32_t height);
		static Texture2D* Create(const std::string& path);
		static Texture2D* Create(const Font& font);
		static Texture2D* Create(const std::string& path, unsigned char* data, int width, int height, int channels, TextureType type = TextureType_ClampToEdge);

		std::string TypeName;
	};

    class CC_EXPORT TextureCube : public Texture
    {
    public:
        static TextureCube* Create(const std::string& path);
        virtual void Generate(unsigned int index, unsigned char* data, int width, int height, int channels, TextureType type = TextureType_ClampToEdge) = 0;

        std::string TypeName;
        std::vector<std::string> Names;
    };

}

#endif